namespace OasisCiq.Xnl
{
    using System;
    using System.Linq;

    /// <summary>
    /// A list of common types for person names
    /// </summary>
    public class PersonNameTypeList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "Alias",
            "LegalName",
            "KnownAs",
            "MaidenName", // Name of an individual before marriage.
            "FormerName", // Former name of the person
            "CommonUse", // Name that is commonly used by others, e.g. a simplified form of the official name.
            "NameAtBirth", // A name given to an individual at birth, but later changed (common in some cultures)
            "PreferredName", // Indicates that the party prefers to be called by this name
            "OfficialName", // An official name of the person, e.g. as in the passport. incorporation certificate, etc.
            "UnofficialName",
            "NickName",
            "PetName"
        };

        public PersonNameTypeList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}